package com.school.gift.controller.admin;

import com.github.pagehelper.PageInfo;
import com.school.gift.model.FeedBackModel;
import com.school.gift.service.FeedbackService;
import com.school.support.base.AdminBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import zhibi.common.support.base.Page;
import zhibi.common.support.mybatis.example.Example;
import zhibi.common.support.mybatis.example.ExampleType;
import zhibi.common.support.mybatis.example.ExampleUtil;

/**
 * Created by 执笔 on 2017/3/23.
 */
@Controller
@RequestMapping("admin/feedback")
public class MFeedbackController extends AdminBaseController{

    @Autowired
    private FeedbackService feedbackService;

    @RequestMapping("list")
    public String list(Model model, Page page){
        Example example = ExampleUtil.getInstance()
                .addOrder("addtime", ExampleType.OrderType.DESC)
                .getExample();
        PageInfo<FeedBackModel> pageInfo = feedbackService.selectModel(example,page);
        setModelAttribute(model,pageInfo);
        return "admin/feedback/list";
    }
}
